package org.hhchat.leetcode.design;

import java.util.ArrayDeque;
import java.util.Deque;

public class code225_easy {

    static class MyStack {

        Deque<Integer> stackQ;

        /** Initialize your data structure here. */
        public MyStack() {
            stackQ = new ArrayDeque<>();
        }

        /** Push element x onto stack. */
        public void push(int x) {
            stackQ.push(x);
        }

        /** Removes the element on top of the stack and returns that element. */
        public int pop() {
            return stackQ.pollLast();
        }

        /** Get the top element. */
        public int top() {
            return stackQ.getFirst();
        }

        /** Returns whether the stack is empty. */
        public boolean empty() {
            return stackQ.isEmpty();
        }
    }

/**
 * Your MyStack object will be instantiated and called as such:
 * MyStack obj = new MyStack();
 * obj.push(x);
 * int param_2 = obj.pop();
 * int param_3 = obj.top();
 * boolean param_4 = obj.empty();
 */
}
